package com.yjd.bi.growing.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.bi.growing.model.UserGrowingGroupModel;
import com.yjd.bi.growing.service.IUserGrowingGroupService;
import com.yjd.bi.growing.dao.IUserGrowingGroupDao;

/**
 * <b>description</b>：用户成长群组业务实现<br>
 * <b>time</b>：2018-08-15 14:33:49 <br>
 * <b>author</b>：  weili valie.lin@foxmail.com
 */
@Service("userGrowingGroupService")
public class UserGrowingGroupServiceImpl extends BaseServiceImpl implements IUserGrowingGroupService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public UserGrowingGroupModel insert(UserGrowingGroupModel model) throws Exception {
		return this.userGrowingGroupDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(UserGrowingGroupModel model) throws Exception {
		return this.userGrowingGroupDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param group_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long group_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("group_id", group_id);
		return this.userGrowingGroupDao.deleteModel(paramMap, true);
	}

	@Resource
	private IUserGrowingGroupDao userGrowingGroupDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.userGrowingGroupDao;
	}

}
